home *** CD-ROM | disk | FTP | other *** search
- Path: transformer.pti-us.com.!news
- From: Walt Dixon <wv.dixon@pti-us.com>
- Newsgroups: comp.lang.c
- Subject: Re: Beginer C please help me
- Date: 22 Mar 1996 22:27:38 GMT
- Organization: Power Technologies Inc.
- Message-ID: <4iv9gq$cpb@transformer.pti-us.com>
- References: <DoLCFx.B7x.0.bloor@torfree.net>
- NNTP-Posting-Host: virgil.pti-us.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 5.3 sun4m)
- X-URL: news:DoLCFx.B7x.0.bloor@torfree.net
-
- The problem you are seeing is due the the fact that both of the operands
- are integers, yeilding an integer result. If you are looking for
- a floating point result I suggest casting either opperand to a float.
-
- n = (float)9/5
-
- or n = 9.0/5;
-
- walt
-
-